1. Field of the Invention
The present invention relates to an information processing apparatus that prevents image deterioration due to scaling processing performed on a semi-transparent object, an information processing method, and storage medium.
2. Description of the Related Art
A semi-transparent object is an object whose transparency (which may be called “transmittance”) is set at a value greater than 0% and less than 100%. This transparency can be set in various applications. For example, in PowerPoint (trademark) by Microsoft Corporation, the transparency can be set on a setting screen as illustrated in FIG. 1. This can be set in steps of 1%.
FIG. 2 illustrates four objects. An object 1 has transparency set at 0%. An object 2 has transparency set at 50%. An object 3 has transparency set at 75%. An object 4 has transparency set at 100%. Of these, the object 2 and the object 3 are semi-transparent objects, the object 1 is a normal (e.g., solid) object, and the object 4 is a completely transparent object.
FIG. 3 is a diagram illustrating the significance of an existence of a semi-transparent object. In FIG. 3, a bar object in dark gray color is disposed behind the objects 1 to 4. Usually, when a certain object is disposed behind another object, the certain object cannot be seen. However, in FIG. 3, since the object 2 and the object 3 are the semi-transparent objects, not only the object 2 and the object 3 but also a part of the bar object disposed behind these objects can be seen. In this way, a semi-transparent object has an effect of allowing a part of an object, that is behind the semi-transparent object, to be seen.
FIG. 4 is a diagram illustrating enlarged views 401 to 404 of the respective objects 1 to 4. In view 401, all pixels forming the object 1 are ON pixels, and the ON pixels each have a density of 32. In view 402, a half of all pixels forming the object 2 are ON pixels, and the remaining half are OFF pixels. An ON pixel means a pixel having a density (e.g., a non-transparent pixel), and an OFF pixel means a pixel not having a density (e.g., a transparent pixel). A pixel having a density of 0 is also an ON pixel, but such a pixel is called a white pixel, and not a transparent pixel. Accordingly, a semi-transparent object is an object expressing semi-transparency by a combination of ON pixels and OFF pixels.
In view 403, 25% of all pixels forming the object 3 are ON pixels, and the remaining 75% are OFF pixels. In view 404, all pixels forming the object 4 are OFF pixels. In the present specification, a description will be given using mainly density as an example. However, “density” and “luminance” have substantially the same meaning, and thus these terms are interchangeable. In other words, the term “density” is assumed to include the term “luminance”.
Now, a semi-transparent object rendering method will be described.
Semi-transparent object rendering processing is implemented using a combination of raster operation (ROP) processing. For example, a method of rendering a semi-transparent object by the combination of an XOR operation, an AND operation, and an XOR operation, will be described with reference to FIG. 6.
As illustrated in FIG. 6, rendering a semi-transparent object on a background requires: (1) overwriting processing, (2) XOR processing, (3) AND processing, and (4) XOR processing. In the following description, the phrase “rendering region” is used. This should be taken to mean a region to be rendered, or in other words a region where an image(s) is (are) to be rendered.
First, in the (1) overwriting processing, a rendering region 601 is overwritten with a background 602. This background 602 is, for example, equivalent to the bar object in dark gray illustrated in FIG. 3. For example, when the rendering region 601 of K=0 is overwritten with the background 602 of K=218, an image 606 is obtained.
Next, in the (2) XOR processing, an image 603 where all pixels are ON pixels is rendered on the image 606, using the XOR operation. The density of each of the ON pixels is equal to the density of the ON pixels in the semi-transparent object, in this example “32”. For example, the XOR operation is performed between the image 603 where all the pixels have the density of K=32 and the background 602 of K=218. In other words, the XOR operation is performed between K=218 (“11011010”) and K=(“00100000”). As a result, the K density of all the pixels becomes 250 (“11111010”). An image 607 illustrates this result.
Next, in the (3) AND processing, a semi-transparent pattern 604 is rendered on the image 607 by using the AND operation. The semi-transparent pattern 604 indicates which pixel in the semi-transparent object is an ON pixel, and which pixel is an OFF pixel. For example, where the semi-transparent pattern 604 has a transparency of 50%, ON pixels (K=255) and OFF pixels (K=0) are alternately arranged. Therefore, the AND operation is performed between K=255 (“11111111”) and the image 607 resulting from the (2) XOR processing. Further, the AND operation is performed between K=0 (“00000000”) and the image 607 resulting from the (2) XOR processing. As a result, the pixel of K=255 in the semi-transparent pattern 604 becomes K=250 (“11111010”), and the pixel of K=0 remains as K=0 (“00000000”), as illustrated in an image 608.
Finally, in the (4) XOR processing, the XOR operation is performed between the image 608 resulting from the (3) AND processing and an image 605 identical with the image 603. In other words, the XOR operation is performed between K=250 (“11111010”) and K=32 (“00100000”). Further, the XOR operation is performed between K=0 (“00000000”) and K=32 (“00100000”). As a result, pixels of K=32 and pixels of K=218 are alternately arranged, as illustrated in an image 609. The semi-transparent object can be thus rendered on the background 602.
The semi-transparent object described above is discussed, for example, in Japanese Patent Application Laid-Open No. 2005-4319.
When this semi-transparent object is scaled, the semi-transparent pattern typically become distorted, which considerably degrades the image quality. This issue will be described below with reference to, for example, an issue arising when using (1) the nearest neighbor method as a reduction method, and an issue arising when using (2) the black pixels saving method as a reduction method.
FIG. 7 illustrates image deterioration when using the (1) nearest neighbor and (2) black pixels saving methods.
When the nearest neighbor method (1) is used, pixels are thinned out according to a reduction ratio, which may distort the semi-transparent pattern. For example, a semi-transparent pattern having transparency of 50% is shown as pattern 701 in which ON pixels and OFF pixels are alternately arranged. When this pattern 701 is reduced by one-half, the reduction is performed by removing pixels except pixels indicated by “*”, and the resulting pattern only contains pixels indicated by “*”. Therefore, as can be seen a completely white image like image 702 is obtained.
When the black pixels saving method (2) is used, a semi-transparent pattern may be distorted as well. When this reduction processing, by which any ON pixels are left remaining, is performed on the semi-transparent pattern 701, if there is only one ON pixel in a 2×2 pixel region 701(a), all the pixels in this region 701(a) are replaced with ON pixels. Therefore, an image 703 may be obtained (although this may be an extreme example).
In either of the (1) nearest neighbor and (2) black pixels saving methods, or even in a case of using any other reduction method, considerable deterioration of a semi-transparent pattern due to the reduction cannot be suppressed.